<template>
	<div>
		<div>
			<Header></Header>
			<div class="main">
				<button id="btn" @click="login">登录</button>
			</div>
			<Footer></Footer>
		</div>
	</div>
</template>


<script>
import Header from '../../components/header/Header.vue'
import Footer from '../../components/footer/Footer.vue'
export default {
	components: {
		Header,
		Footer,
	},
	data() {
		return {}
	},

	created() {},

	methods: {
		login() {
			//   this.$router.push('/login');
			// console.log('点击登录')
			var arr = [1, 2, 3, 4]
			arr.forEach((item, index) => {
				console.log(item, index)
				Object.defineProperty(arr, index, {
					set: (val) => {
						console.log('触发setter')
						console.log(val)
						console.log(index)
					},
					getters: () => {
						console.log('触发getter方法')
					},
				})
			})
			arr[1] = '123'
			arr[1]
			arr[5] = 5
		},
	},
}
</script>
<style scoped lang='scss'>
button {
	width: 100px;
	height: 50px;
}
.main {
	width: 100%;
	height: 400px;
	background-color: chocolate;
}
</style>
